﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:Gronia.WPF.Controls"
                    xmlns:converter="clr-namespace:Gronia.WPF.Converters">
    <converter:CenterConverter x:Key="CenterConverter"/>
    <Style TargetType="{x:Type local:PageTransition}">
        <Setter Property="ClipToBounds" Value="True"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:PageTransition}">
                    <ContentControl x:Name="ContentControl" Content="{TemplateBinding Content}">
                        <ContentControl.RenderTransform>
                            <TransformGroup>
                                <ScaleTransform ScaleX="1" ScaleY="1" CenterX="{Binding ActualWidth, Converter={StaticResource CenterConverter}}" CenterY="{Binding ActualHeight, Converter={StaticResource CenterConverter}}" />
                                <SkewTransform AngleX="0" AngleY="0" CenterX="{Binding ActualWidth, Converter={StaticResource CenterConverter}}" CenterY="{Binding ActualHeight, Converter={StaticResource CenterConverter}}" />
                                <RotateTransform Angle="0" CenterX="{Binding ActualWidth, Converter={StaticResource CenterConverter}}" CenterY="{Binding ActualHeight, Converter={StaticResource CenterConverter}}" />
                                <TranslateTransform X="0" Y="0" />
                            </TransformGroup>
                        </ContentControl.RenderTransform>
                        <ContentControl.LayoutTransform>
                            <ScaleTransform />
                        </ContentControl.LayoutTransform>
                    </ContentControl>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>